home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / lib / tclX-6.4 / help / files / lgets < prev    next >
Encoding:
Text File  |  1992-12-17  |  1.4 KB  |  25 lines

  1.  
  2.  
  3.           lgets fileId [varName]
  4.                Reads the next Tcl list from the file given by fileId
  5.                and discards the terminating newline character.  This
  6.                command differs from the gets command, in that it reads
  7.                Tcl lists rather than lines.  If the list contains a
  8.                newline, then that newline will be returned as part of
  9.                the result.  Only a newline not quoted as part of the
  10.                list indicates the end of the list.  There is no
  11.                corresponding command for outputing lists, as puts will
  12.                do this correctly.  If varName is specified, then the
  13.                line is placed in the variable by that name and the
  14.                return value is a count of the number of characters
  15.                read (not including the newline).  If the end of the
  16.                file is reached before reading any characters then -1
  17.                is returned and varName is set to an empty string.  If
  18.                varName is not specified then the return value will be
  19.                the line (minus the newline character) or an empty
  20.                string if the end of the file is reached before reading
  21.                any characters.  An empty string will also be returned
  22.                if a line contains no characters except the newline, so
  23.                eof may have to be used to determine what really
  24.                happened.
  25.